package com.lqian.demo02.utils.test.dao.service;

import com.lqian.demo02.utils.JDBCUtils;
import com.lqian.demo02.utils.test.dao.DaoUtils;
import com.lqian.demo02.utils.test.dao.mapper.UserRowMapper;
import com.lqian.demo02.utils.test.pojo.Users;

import java.sql.SQLException;
import java.util.List;

/**
 * @author：Melody_LQ
 * @time：2022/7/14 5:04 下午
 */
public class UserService {

    private static  DaoUtils daoUtils = new DaoUtils();


    public static void main(String[] args) {
        String sql = "select * from users";
        try {
            //开启事务
            List list = daoUtils.commonSelect(sql, new UserRowMapper(), null);
            System.out.println(list);
            //commit
        } catch (SQLException e) {
            //rollback
            e.printStackTrace();
        }
    }
}
